<template>
  <div>
    <div class="in" style="padding: 1rem 0px">
      <label style="font-size: 1rem">所在网点：</label><label style="color: #b5b3b3;" v-text="Dispatch.agencyName"></label>
      <label class="label1">作业状态：</label>
      <label class="label" v-if="Dispatch.pdTaskPickupDispatch.status === 1 ">待执行</label>
      <label class="label" v-if="Dispatch.pdTaskPickupDispatch.status === 2 ">进行中</label>
      <label class="label" v-if="Dispatch.pdTaskPickupDispatch.status === 3 ">待确认</label>
      <label class="label" v-if="Dispatch.pdTaskPickupDispatch.status === 4 ">已完成</label>
      <label class="label" v-if="Dispatch.pdTaskPickupDispatch.status === 5 ">已取消</label>
      <label class="label1">取件快递员：</label>
      <label class="label" v-text="Dispatch.name"></label>
    </div>
    <div class="in" style="padding: 1rem 0px">
      <label style="font-size: 1rem">快递员电话：</label>
      <label class="label" v-text="Dispatch.courierPhone"></label>
      <label class="label1">派件完成时间：</label>
      <label class="label" v-text="Dispatch.pdTaskPickupDispatch.actualEndTime"></label>
    </div>
  </div>
</template>
<script>
import OrderAPI from '../../../../src/api/logisticsmanagement/ordermanagement/orderAPI'

export default {
  props: ['id'],
  data() {
    return {
      orderId: '',
      Dispatch: {
        pdTaskPickupDispatch: {
          status: 1,
          estimatedStartTime: '',
          actualStartTime: '',
          estimatedEndTime: '',
          actualEndTime: ''
        },
        agencyName: '',
        name: '',
        courierPhone: ''
      }
    }
  },
  methods: {
    getDelivery() {
      // 获取取件
      OrderAPI.getDelivery(this.orderId, 2).then(({data}) => {
        this.Dispatch.pdTaskPickupDispatch = data.data
      })
    }
  },
  watch: {
    id: function (oid) {
      this.orderId = oid
      this.getDelivery()
    }
  }
}
</script>
<style>

</style>
